package com.ganee.agora.repository

import com.ganee.agora.api.MainApiService
import com.ganee.agora.model.CollectActivityEntity
import com.ganee.agora.model.HomeListBean
import com.ganee.agora.model.InsertActivityEntity
import com.ganee.agora.model.TicketInfoEntity
import com.ganee.baselib.httprequest.callback.RequestCallback
import com.ganee.baselib.mvvmlibrary.base.BaseRepository
import com.ganee.baselib.mvvmlibrary.base.BaseViewModel

class HomeRepository(baseViewModel: BaseViewModel<*>) : BaseRepository(baseViewModel) {

    /**
     * 获取首页列表
     */
    fun getHomeList(callback: RequestCallback<List<HomeListBean>>) {
        executeQuietly(getApi(MainApiService::class.java).postHomeList(), callback)
    }


    /**
     * 获取已发布列表
     */
    fun getHostEventList(callback: RequestCallback<List<InsertActivityEntity>>) {
        executeQuietly(getApi(MainApiService::class.java).hostEventList, callback)
    }

    /**
     * 获取已发布列表
     */
    fun getCollectList(callback: RequestCallback<List<InsertActivityEntity>>) {
        executeQuietly(getApi(MainApiService::class.java).collectList, callback)
    }

    /**
     * 获取已发布列表
     */
    fun getRegistrationsList(callback: RequestCallback<List<InsertActivityEntity>>) {
        executeQuietly(getApi(MainApiService::class.java).registrationsList, callback)
    }


    /**
     * 获取过期票列表
     */
    fun postPastTicketList(callback: RequestCallback<List<TicketInfoEntity>>) {
        executeQuietly(getApi(MainApiService::class.java).postPastTicketList(), callback)
    }
    /**
     * 获取过期票列表
     */
    fun postUpCommingTicketList(callback: RequestCallback<List<TicketInfoEntity>>) {
        executeQuietly(getApi(MainApiService::class.java).postUpCommingTicketList(), callback)
    }
}
